import 'package:flutter/material.dart';

import '../../res/gaps.dart';
import '../../src/utils/other_utils.dart';
import '../../src/widgets/click_item.dart';
import '../../tools/widgets/PayTypeDialog.dart';
import '../../tools/widgets/my_app_bar.dart';

class UserEditPage extends StatefulWidget {
  const UserEditPage({super.key});

  @override
  State<UserEditPage> createState() => _UserEditPageState();
}

class _UserEditPageState extends State<UserEditPage> {

  bool _check = false;
  List<int> _selectValue = [0];
  int _sendType = 0;
  String _sendPrice = '0.00';
  String _freePrice = '0.00';
  String _phone = '';
  String _shopIntroduction = '零食铺子坚果饮料美酒佳肴…';
  String _securityService = '假一赔十';
  String _address = '陕西省 西安市 长安区 郭杜镇郭北村韩林路圣方医院斜对面';


  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: const MyAppBar(
        // title: const Text('用户编辑页'),
        centerTitle: '用户编辑页',

      ),
      body: ListView(
        padding: const EdgeInsets.all(16.0),
        children: [
          Gaps.vGap16, // 垂直间距
          ClickItem(
            title: '运费配置',
            content: _sendType == 0 ? '运费满免配置' : '运费比例配置',
            onTap: _showPayTypeDialog,
          ),
          // 其他内容可以继续添加在这里
        ],
      ),
    );
  }







  void _showPayTypeDialog() {
    showElasticDialog<void>(
      context: context,
      barrierDismissible: false,
      builder: (BuildContext context) {
        return PayTypeDialog(
          value: _selectValue,
          onPressed: (value) {
            setState(() {
              _selectValue = value.cast<int>();
            });
          },
        );
      },
    );
  }







}
















